package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 批量插入套餐菜品关系数据
     * @param setmealDishes 菜品关系数据集合
     */
    void insertSetmealDishS(List<SetmealDish> setmealDishes);

    /**
     * 根据套餐id删除套餐菜品关系数据
     * @param setmealId
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteByDishId(Long setmealId);

    /**
     * 根据套餐id查询套餐菜品关系数据
     * @param setmealId 套餐id
     * @return SetmealDish集合
     */
    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getdish(Long setmealId);

    /**
     * 根据菜品id批量删除套餐菜品关系数据
     * @param ids 菜品id集合
     */
    void deleteByDishIds(List<Long> setmealIds);
}
